﻿@using NTQOnlineExam.Services.Infrastructure.MVC
@using NTQOnlineExamFrontend.Models
@model NTQOnlineExamFrontend.Models.OrderHistoryViewModel


@if (Model.Orders != null)
{
    foreach (var item in Model.Orders)
    {
    <tr>
        <td>@item.OrderUniqueId</td>
        <td>@item.CreationDateDisplay</td>
        <td class="number wid-90">@item.SubTotalDisplay</td>
        <td>@item.StatusDescription</td>
        <td><a href="@Url.RouteUrl(new { Controller = "Order", Action = "OrderHistoryDetail", orderId = item.OrderId })">Detail</a></td>
    </tr>
    }
}
@*TODO: Use this to paging *@
||||||||
@{
    var pagingModel = new PagingModel
    {
        PageCount = Model.PageCount,
        SelectedPage = Model.SelectedPage,
        Href = string.Empty,
        OnClickFunction = "ChangeOrderHistoryPage"
    };
    Html.RenderPartial("_Paging", pagingModel);
}
<script type="text/javascript">
    function ChangeOrderHistoryPage(page) {
        $("#orderhistory-selectedpage").val(page);
        NQTSort.RequestData();
    }
</script>
